
*** Fig 1B Buhaug & Vestby SSP GEP 2019 https://doi.org/10.1162/glep_a_00525 ***

* Load GDP projections based on replication data from Hegre et al. ERL 2016 (original file: PredictionSSP_1.dta)
use Fig1B.dta, clear

* Fig1B - spaghetti plot of economic development, all countries 1970-2099, SSP3
xtset gwno year
gen lGDPcapSSP3=ln(GDPcapSSP3)
xtline lGDPcapSSP3 if year>=1970, overlay legend(off) scheme(s1color) ///
ytitle(Log(GDP/capita), size(small)) ylabel(, labsize(small)) xtitle(Year, size(small)) ///
xline(2014) xlabel(1970(10)2100, labsize(small) angle(vertical)) xsize(5.5) ysize(5.5) aspectratio(1)



*** Not shown in article: historical and projected economic development for countries with GDP/capita < $1000 in 2013
gen x=1 if GDPcapSSP3<1000 & year==2013
bys gwno: egen y=max(x)
bys year: egen mgdp3=mean(GDPcapSSP3) if y==1
gen lmgdp3=ln(mgdp3)

* simple mean for group
xtline lmgdp3 if year>=1970, overlay legend(off) scheme(s1color) ///
ytitle(Log(GDP/capita), size(small)) ylabel(, labsize(small)) xtitle(Year, size(small)) ///
xline(2014) xlabel(1970(10)2100, labsize(small) angle(vertical)) xsize(5.5) ysize(5.5) aspectratio(1)

* plot for individual countries
xtline lGDPcapSSP3 if year>=1970 & y==1, overlay legend(off) scheme(s1color) ///
ytitle(Log(GDP/capita), size(small)) ylabel(, labsize(small)) xtitle(Year, size(small)) ///
xline(2014) xlabel(1970(10)2100, labsize(small) angle(vertical)) ylabel(4(2)12) xsize(5.5) ysize(5.5) aspectratio(1)

